package com.lheia.util

class ToolUrl {
    /**
     * 获取绝对路径
     * @param baseURI
     * @param relativePath
     * @return
     */
    static String getAbsoluteURL(String baseURI, String relativePath) {
        if(relativePath.indexOf("http")>-1){
            return relativePath
        }
        String abURL = null;
        URI base = new URI(baseURI);// 基本网页URI
        URI abs = base.resolve(relativePath);// 解析于上述网页的相对URL，得到绝对URI
        URL absURL = abs.toURL();// 转成URL
        abURL = absURL.toString();
        return abURL
    }

}
